# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=tuxpaint
pkgver=0.9.31
pkgrel=1
pkgdesc="Drawing program designed for young children"
# useless on s390x
arch="all !s390x"
url="https://tuxpaint.org/"
license="GPL-2.0-or-later"
depends="
	hicolor-icon-theme
	xdg-utils
	"
makedepends="
	gperf
	imagemagick
	libimagequant-dev
	libpaper-dev
	librsvg-dev
	sdl2-dev
	sdl2_gfx-dev
	sdl2_image-dev
	sdl2_mixer-dev
	sdl2_pango-dev
	sdl2_ttf-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://sourceforge.net/projects/tuxpaint/files/tuxpaint/$pkgver/tuxpaint-$pkgver.tar.gz/download"
options="!check" # no test suite

prepare() {
	default_prepare

	# Set fullscreen native resolution by default
	sed -i \
		-e 's/# fullscreen=.*/fullscreen=yes/' \
		-e 's/# native=.*/native=yes/' \
		src/tuxpaint.conf
}

build() {
	make -j1 \
		CFLAGS="$CFLAGS $(pkg-config --cflags pango) -D_POSIX_PRIORITY_SCHEDULING" \
		PREFIX=/usr
}

package() {
	make -j1 \
		PREFIX=/usr \
		GNOME_PREFIX=/usr \
		X11_ICON_PREFIX="$pkgdir"/usr/share/pixmaps \
		DESTDIR="$pkgdir" \
		install

	install -Dm644 src/$pkgname.desktop \
		"$pkgdir"/usr/share/applications/$pkgname.desktop
}

sha512sums="
7a3df8dce3e354cc22af34d55546de6e033e8ed4f44530b89986c3e1a07961e5e1a132f12f2d3fc5b699c500e7b9e7ab3503d2bafc5041d9fb2dbc8d1479b79f  tuxpaint-0.9.31.tar.gz
"
